 <!DOCTYPE html>
<html lang="en">
<head>
          <meta charset="UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>Document</title>
          <script src="./js上课编程.js"></script>
</head>
<body>
      <h1>超市促销</h1>
      请输入结账金额<input type="text" id="money"><br>
      是否为会员<input type="text" id="isVIP"><br>
      <input type="button" value="结账" id="btn" onclick="check()"><br>
      运行结果: <input type="text" id="result">
</body>
<script>
          function check(){
                    var money = document.getElementById("money").value;
                    var isVIP = document.getElementById("isVIP").value;
                    var result = document.getElementById("result").value;
                    if(isVIP=1){
                    result = 0.8 * money
          }else{
                    result = 0.9 * money;
          };
          if((isVIP==0) && (money>=100)){
                    result = 0.9 * money
          }else{
                    result = money
          }
          document.getElementById("result").value = result
          }; 

</script>
</html>